#13904 - Added structured/detailed view for external message display#13919
Conversation
📝 WalkthroughWalkthroughThe changes implement a dual-view interface for external message rendering. A new Changes
Sequence DiagramsequenceDiagram
actor User
participant Form as ExternalMessageForm
participant TabSheet as TabSheet Container
participant StructuredView as Structured View
participant DetailedView as Detailed View
participant Facade as ExternalMessageAdapterFacade
User->>Form: Open external message
Form->>Form: setValue(message)
Form->>TabSheet: Clear all tabs
Form->>TabSheet: Initialize two tabs
Form->>StructuredView: Load lazily
StructuredView->>Facade: convertToHTML(message)
alt Conversion successful
Facade-->>StructuredView: HTML result
StructuredView->>TabSheet: Render HTML
else Conversion failed
StructuredView->>TabSheet: Render XML fallback
StructuredView->>User: Show warning popup
end
Form->>TabSheet: Select structured tab
User->>TabSheet: Click detailed view tab
Form->>DetailedView: Load lazily
DetailedView->>Facade: convertToDetailedHTML(message)
alt Conversion successful
Facade-->>DetailedView: Detailed HTML result
DetailedView->>TabSheet: Render detailed HTML
else Conversion failed
DetailedView->>TabSheet: Render XML fallback
DetailedView->>User: Show warning popup
end
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/ExternalMessageForm.java (1)
144-168: Log the exception object here.
logger.error(e.getMessage())drops the stack trace, which makes conversion failures much harder to diagnose in production.♻️ Suggested fix
- } catch (Exception e) { - structuredViewContainer.addComponent(createXmlDisplay(externalMessage.getExternalMessageDetails())); - logger.error(e.getMessage()); + } catch (Exception e) { + structuredViewContainer.addComponent(createXmlDisplay(externalMessage.getExternalMessageDetails())); + logger.error("Failed to render structured external message view", e); } @@ - } catch (Exception e) { - detailedViewContainer.addComponent(createXmlDisplay(externalMessage.getExternalMessageDetails())); - logger.error(e.getMessage()); + } catch (Exception e) { + detailedViewContainer.addComponent(createXmlDisplay(externalMessage.getExternalMessageDetails())); + logger.error("Failed to render detailed external message view", e); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/ExternalMessageForm.java` around lines 144 - 168, In ExternalMessageForm update the exception logging in the catch blocks (the one that follows structuredViewContainer.addComponent(createXmlDisplay(...)) and the catch in loadDetailedView) to log the exception object instead of only e.getMessage(); replace logger.error(e.getMessage()) with a call that includes a short contextual message and the exception (e.g., logger.error("Failed to convert external message to detailed HTML", e)) so the full stack trace is recorded for debugging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/ExternalMessageForm.java`:
- Around line 144-168: In ExternalMessageForm update the exception logging in
the catch blocks (the one that follows
structuredViewContainer.addComponent(createXmlDisplay(...)) and the catch in
loadDetailedView) to log the exception object instead of only e.getMessage();
replace logger.error(e.getMessage()) with a call that includes a short
contextual message and the exception (e.g., logger.error("Failed to convert
external message to detailed HTML", e)) so the full stack trace is recorded for
debugging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8f6ee0de-4f0a-48d3-b08c-648d284514c9
📒 Files selected for processing (5)
sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/ExternalMessageAdapterFacade.javasormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.javasormas-api/src/main/resources/captions.propertiessormas-ui/src/main/java/de/symeda/sormas/ui/externalmessage/ExternalMessageForm.javasormas-ui/src/main/webapp/VAADIN/themes/sormas/views/lab-message.scss
Fixes #13904
Summary by CodeRabbit
New Features
Improvements